/*
 * WidgetClickeableWithTextAligned.cpp
 *
 *  Created on: Apr 21, 2012
 *      Author: alan
 */

#include "WidgetClickeableWithTextAligned.h"

WidgetClickeableWithTextAligned::WidgetClickeableWithTextAligned(std::string text,Color color,int width,
		int height,int posX, int posY, Widget* parent):
WidgetClickeable(color,width,height,posX,posY,parent){
	this->text = text;
	this->label = new LabelAligned(text,this, this->parcel->width /2 ,this->parcel->height/2);
}


WidgetClickeableWithTextAligned::WidgetClickeableWithTextAligned(std::string text,std::string path,int posX, int posY, Widget* parent):
WidgetClickeable(path,posX,posY,parent){
	this->text = text;
	this->label = new LabelAligned(text,this,this->parcel->width /2 ,this->parcel->height/2);

}

void WidgetClickeableWithTextAligned::showOn(SDL_Surface* surface) {
	label->showOn(this->surface);
	Widget::showOn(surface);
}

std::string WidgetClickeableWithTextAligned::getText(){
	return this->text;
}

WidgetClickeableWithTextAligned::~WidgetClickeableWithTextAligned() {
	delete this->label;
}
